window: Fail if the parent window and the visual don't match
authorBenjamin Otte <otte@redhat.com>
Thu, 27 Sep 2012 11:42:10 +0000 (13:42 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 28 Sep 2012 16:27:49 +0000 (18:27 +0200)
They must be on the same screen.

gdk/gdkwindow.c

index ae77620888496d11bdfcb217cc867b6563356f7b..206edc3b699d26e4d5a69cfa021f7ebc33ddb460 100644 (file)
@@ -1363,6 +1363,11 @@ gdk_window_new (GdkWindow     *parent,
       return NULL;
     }
 
+  if (attributes_mask & GDK_WA_VISUAL)
+    {
+      g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
+    }
+
   display = gdk_screen_get_display (screen);
 
   window = _gdk_display_create_window (display);